#ifndef BLOCK_H
#define BLOCK_H

#include "word.h"
#include "blockid.h"
#include "arryimpl.h"

class Block : private SmartArrayImpl<Word, 8>
{
	BlockID blockID_;
public:
	Block() : blockID_(BLOCK_NONE), SmartArrayImpl<Word, 8>()
	{
	}
	Block(Block &block) : blockID_(block.blockID_),
		SmartArrayImpl<Word, 8>(block)
	{
	}
	void setID(BlockID blockID)
	{
		blockID_ = blockID;
	}
	BlockID getID()
	{
		return blockID_;
	}
	void operator=(Block &block)
	{
		blockID_ = block.blockID_;
		SmartArrayImpl<Word, 8>::operator=(block);
	}
	bool addWord(char address, long int value)
	{
		return SmartArrayImpl<Word, 8>::add(Word(address, value));
	}
	Word *begin()
	{
		return SmartArrayImpl<Word, 8>::begin();
	}
	Word *end()
	{
		return SmartArrayImpl<Word, 8>::end();
	}
};

#endif
